<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container" th:fragment="header">
    <!-- logo -->
    <div class="navbar-header">
        <a href="/" class="navbar-brand">博雅诗词</a>
    </div>
    <!-- 栏目 -->
    <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li class="active"><a href="/">首页</a></li>
            <li><a href="/hots/1">排行</a></li>
            <li><a href="#">作者</a></li>
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的 <span class="caret"></span></a>
                <ul class="dropdown-menu">
                    <li><a href="/collection/1">我的收藏</a></li>
                    <li><a href="#">我的文字</a></li>
                    <li><a href="#">浏览历史</a></li>
                    <li><a href="/stone/1">我的积分</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">我的空间</a></li>
                    <li th:if="${user==null}"><a th:href="@{/login}">我要登录</a></li>
                    <li th:if="${user!=null}"><a th:href="@{/logout}">我要退出</a></li>
                </ul>
            </li>
        </ul>

        <!-- 搜索框 -->
        <form class="navbar-form navbar-right" th:action="@{/findByWord}">
            <div class="input-group">
                <input type="text" class="form-control" name="keyWord" placeholder="搜索关键字...">
                <span class="input-group-btn">
                                    <button class="btn btn-default" type="submit">
                                        <span class="glyphicon glyphicon-search"></span></button>
                                </span>
            </div>
        </form>
    </div>
</div>

</body>
</html>